// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// Copyright (c) KALEIDOS INC

@use "refactor/common-refactor.scss" as deprecated;

.history-toolbox {
  display: flex;
  flex-direction: column;
  background-color: var(--panel-background-color);
}

.history-toolbox-title {
  @include deprecated.flexCenter;
  @include deprecated.uppercaseTitleTipography;
  position: relative;
  height: deprecated.$s-32;
  min-height: deprecated.$s-32;
  margin: deprecated.$s-8 deprecated.$s-8 0 deprecated.$s-8;
  border-radius: deprecated.$br-8;
  background-color: var(--panel-title-background-color);

  span {
    @include deprecated.flexCenter;
    flex-grow: 1;
    color: var(--title-foreground-color-hover);
  }
}

.history-entry-empty {
  @include deprecated.flexCenter;
  flex-direction: column;
  gap: deprecated.$s-16;
  padding: deprecated.$s-28 deprecated.$s-16;
  text-align: center;
}

.history-entry-empty-icon {
  @extend .empty-icon;
  svg {
    margin-left: calc(-1 * deprecated.$s-2);
  }
}

.history-entry-empty-msg {
  @include deprecated.bodySmallTypography;
  color: var(--empty-message-foreground-color);
}

.history-entries {
  height: calc(100vh - deprecated.$s-100);
  padding: deprecated.$s-12;
  overflow-x: hidden;
  overflow-y: auto;
  font-size: deprecated.$fs-12;
}

.history-entry {
  display: flex;
  justify-content: center;
  flex-direction: column;
  min-height: deprecated.$s-32;
  margin: deprecated.$s-4;
  padding: deprecated.$s-4 deprecated.$s-8;
  border: deprecated.$s-2 solid transparent;
  border-radius: deprecated.$s-8;
  background-color: var(--entry-background-color);
  cursor: pointer;
  transition: border 0.2s;

  .history-entry-summary {
    display: flex;
    align-items: center;
    .history-entry-summary-icon {
      svg {
        @extend .button-icon-small;
        stroke: var(--entry-foreground-color);
      }
    }
    .history-entry-summary-text {
      margin: 0 deprecated.$s-8;
      color: var(--color-foreground-primary);
    }
    .history-entry-summary-button {
      opacity: deprecated.$op-0;
      margin-left: auto;
      &.button-opened {
        svg {
          transform: rotate(90deg);
        }
      }
      svg {
        @extend .button-icon-small;
        stroke: var(--entry-foreground-color);
      }
    }
  }

  .history-entry-detail {
    display: block;
    padding-top: deprecated.$s-16;
    color: var(--modal-text-foreground-color);
    .history-entry-details-list {
      margin: 0;
    }
  }

  &.disabled {
    border-color: var(--entry-border-color-disabled);
    background-color: var(--entry-background-color-disabled);
  }

  &.hover,
  &:hover {
    background-color: var(--entry-background-color-hover);
    color: var(--entry-foreground-color-hover);
    .history-entry-summary {
      .history-entry-summary-icon {
        svg {
          stroke: var(--entry-foreground-color-hover);
        }
      }
      .history-entry-summary-button {
        opacity: deprecated.$op-10;
        &.button-opened {
          svg {
            transform: rotate(90deg);
          }
        }
      }
    }
  }
}
